export default function user(state = { name: 'zs', age: 18 }, action) {
  switch (action.type) {
    case 'UPDATE_NAME':
      return {
        ...state,
        name: action.payload,
      }
    case 'UPDATE_AGE':
      return {
        ...state,
        age: state.age + 1,
      }
    default:
      return state
  }
}
